package com.fqgj.sentry.policy.engine.domain;

import com.fqgj.sentry.policy.engine.domain.enums.PolicyTypeEnum;
import com.fqgj.sentry.policy.engine.domain.enums.RuleComposeEnum;

import java.io.Serializable;
import java.util.List;

/**
 * Created by kennykong on 13/07/2017.
 */
public class Policy implements Serializable {

    /**
     * 策略名
     */
    private String policyName;

    /**
     * 公共规则，判断此条策略要不要执行
     */
    private Rule commonRule;

    /**
     * 策略id
     */
    private Long policyId;

    /**
     * 策略种类:评分卡|规则组
     */
    private PolicyTypeEnum policyType;
    /**
     * 策略为规则组时   优先级最高的结果
     */
    private Decision highPriorityDecision;

    /**
     * 规则的组合方式:首次匹配|最坏匹配|权重匹配
     */
    private RuleComposeEnum ruleCompose;

    /**
     * 权重取值范围（判断落在那个区间）
     */
    private List<WeightRange> weightRange;

    /**
     * 规则列表
     */
    private List<Rule> ruleList;

    /**
     * 策略结果
     */
    private PolicyResult policyResult;

    /**
     * 策略评分卡变量，初始状态为要设的变量名和基础分，不要改动
     */
    private Variable initalScoreVariable;

    /**
     * 策略排序值
     */
    private Integer order;

    public Decision getHighPriorityDecision() {
        return highPriorityDecision;
    }

    public Policy setHighPriorityDecision(Decision highPriorityDecision) {
        this.highPriorityDecision = highPriorityDecision;
        return this;
    }

    public String getPolicyName() {
        return policyName;
    }

    public Policy setPolicyName(String policyName) {
        this.policyName = policyName;
        return this;
    }

    public Long getPolicyId() {
        return policyId;
    }

    public Policy setPolicyId(Long policyId) {
        this.policyId = policyId;
        return this;
    }

    public PolicyTypeEnum getPolicyType() {
        return policyType;
    }

    public Policy setPolicyType(PolicyTypeEnum policyType) {
        this.policyType = policyType;
        return this;
    }

    public RuleComposeEnum getRuleCompose() {
        return ruleCompose;
    }

    public Policy setRuleCompose(RuleComposeEnum ruleCompose) {
        this.ruleCompose = ruleCompose;
        return this;
    }

    public List<WeightRange> getWeightRange() {
        return weightRange;
    }

    public Policy setWeightRange(List<WeightRange> weightRange) {
        this.weightRange = weightRange;
        return this;
    }

    public List<Rule> getRuleList() {
        return ruleList;
    }

    public Policy setRuleList(List<Rule> ruleList) {
        this.ruleList = ruleList;
        return this;
    }

    public PolicyResult getPolicyResult() {
        return policyResult;
    }

    public Policy setPolicyResult(PolicyResult policyResult) {
        this.policyResult = policyResult;
        return this;
    }

    public Variable getInitalScoreVariable() {
        return initalScoreVariable;
    }

    public Policy setInitalScoreVariable(Variable initalScoreVariable) {
        this.initalScoreVariable = initalScoreVariable;
        return this;
    }

    public Rule getCommonRule() {
        return commonRule;
    }

    public Policy setCommonRule(Rule commonRule) {
        this.commonRule = commonRule;
        return this;
    }

    public Integer getOrder() {
        return order;
    }

    public Policy setOrder(Integer order) {
        this.order = order;
        return this;
    }
}
